package com.loongtech.bi.action.rest;

import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletResponse;

@RestController
public class Test {
    //@CrossOrigin(origins = "http://10.236.44.206:80")
    @RequestMapping(value="/rest/getname.do")
    public String getName(@RequestParam(value="name") String name){
        HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
        response.setHeader("Access-Control-Allow-Origin","*");
        return name;
    }



}